package com.aaa.test.contronller;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName PageController
 * @Description TODO
 * @Aythor WYX
 * @Date 2022/11/2 17:02
 * Version 1.0
 **/
@Controller
public class UseController {
    //登录成功后
    ////.successForwardUrl("/success") 即账号密码输入成功后 发出seccess请求 跳转至成功页面
    @GetMapping("info")
    @ResponseBody
    public Authentication info(){
        return SecurityContextHolder.getContext().getAuthentication();
    }




    @PostMapping("/success")
    public String success(){
        return "success";
    }
}
